package com.study.androidsystem.anno_reflec;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.blankj.utilcode.util.ToastUtils;
import com.study.androidsystem.R;
import com.study.androidsystem.anno_reflec.injectListener.InjectListenerUtil;
import com.study.androidsystem.anno_reflec.injectListener.OnClick;
import com.study.androidsystem.anno_reflec.injectListener.OnLongClick;
import com.study.androidsystem.anno_reflec.injectView.InjectUtil;
import com.study.androidsystem.anno_reflec.injectView.InjectView;


public class AnnoActivity extends AppCompatActivity {

    @InjectView(value = R.id.tv_anno)
    TextView tvAnno;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anno);
        InjectUtil.inject(this);
        InjectListenerUtil.injectEvent(this);
        tvAnno.setText("success");
    }

    @OnClick(R.id.btn_click)
    void clickView(View view) {
        ToastUtils.showShort("点击");
    }

    @OnLongClick(R.id.btn_longclick)
    void longClickView(View view) {
        ToastUtils.showShort("长按");
    }
}
